package user

import (
	"praiselife_gin/app/api/model"
	"praiselife_gin/library/controller"
	"praiselife_gin/library/db"

	"github.com/gin-gonic/gin"
)

type User struct {
	controller.Controller
}

func Login(ctx *gin.Context) {
	u := new(User)
	var FaUser model.FaUser
	result := db.DB.Where("id = ?", 1).Find(&FaUser)
	if result.RowsAffected < 1 {
		u.ToJSON(ctx, 201, "查不到数据", []int{})
		return
	}
	u.ToJSON(ctx, 200, "ok", FaUser)
}
